<!--
 * @Description: 
 * @Author: xuechengwu
 * @Email: 516385822@qq.com
 * @Date: 2022-02-07 17:29:11
 * @LastEditTime: 2022-02-07 17:32:20
 * @LastEditors: xuechengwu
-->
<template>
  <el-input
    :size="size"
    v-model="value"
    @change="change"
  >
    <slot v-for="(_, name) in $slots" :name="name" :slot="name" />
  </el-input>
</template>

<script>
export default {
    props: ['defaultValue', 'size'],
    watch: {
        defaultValue(val) {
            this.value = val;
        },
    },
    data() {
        return {
            value: '',
        };
    },
    mounted() {
        this.value = this.defaultValue;
    },
    methods: {
        change(value) {
            this.$emit('change', value);
        }
    }
}
</script>

<style>

</style>